{% extends 'html模板/案件-base.html' %}
{% load staticfiles %}
{% block css %}

{% endblock %}

{% block mianbaoxiedaohang %}
    新增案件
{% endblock %}

{% block main %}
    <form action="/add/" method="post" style="border: #b4b4b4 1px solid;margin: 10px auto;padding-bottom: 10px">
        <input type="text" hidden name="aj_user" id="user" style="display: none;">
        {% csrf_token %}
        <div id="collapse1" class="panel-collapse collapse in">
            <div class="panel-body">
                <div class="form-group span4 {% if obj.aj_xingzhi.errors.0 %}has-error{% endif %}">
                    <label for="id_aj_xingzhi">{{ obj.aj_xingzhi.label }}</label>
                    {{ obj.aj_xingzhi }}
                    <span class="help-block">{{ obj.aj_xingzhi.errors.0 }}</span>
                </div>
                <div class="form-group span4 {% if obj.aj_zhonglei.errors.0 %}has-error{% endif %}">
                    <label for="id_aj_zhonglei">{{ obj.aj_zhonglei.label }}</label>
                    {{ obj.aj_zhonglei }}
                    <span class="help-block">{{ obj.aj_zhonglei.errors.0 }}</span>
                </div>
                <div class="form-group span4 {% if obj.aj_sheanjine.errors.0 %}has-error{% endif %}">
                    <label for="id_aj_sheanjine">{{ obj.aj_sheanjine.label }}</label>
                    {{ obj.aj_sheanjine }}
                    <span class="help-block">{{ obj.aj_sheanjine.errors.0 }}</span>
                </div>
                <div class="form-group span4 {% if obj.aj_laiyuan.errors.0 %}has-error{% endif %}">
                    <label for="id_aj_laiyuan">{{ obj.aj_laiyuan.label }}</label>
                    {{ obj.aj_laiyuan }}
                    <span class="help-block">{{ obj.aj_laiyuan.errors.0 }}</span>
                </div>
                <div class="form-group span4 {% if obj.aj_time1.errors.0 %}has-error{% endif %}">
                    <label for="id_aj_time1">{{ obj.aj_time1.label }}</label>
                    {{ obj.aj_time1 }}
                    <span class="help-block">{{ obj.aj_time1.errors.0 }}</span>
                </div>
                <div class="form-group span4 {% if obj.aj_dangshiren.errors.0 %}has-error{% endif %}">
                    <label for="id_aj_dangshiren">{{ obj.aj_dangshiren.label }}</label>
                    {{ obj.aj_dangshiren }}
                    <span class="help-block">{{ obj.aj_dangshiren.errors.0 }}</span>
                </div>
                <div class="form-group span4 {% if obj.aj_faren.errors.0 %}has-error{% endif %}">
                    <label for="id_aj_faren">{{ obj.aj_faren.label }}</label>
                    {{ obj.aj_faren }}
                    <span class="help-block">{{ obj.aj_faren.errors.0 }}</span>
                </div>
                <div class="form-group span4 {% if obj.aj_jigoudaima.errors.0 %}has-error{% endif %}">
                    <label for="id_aj_jigoudaima">{{ obj.aj_jigoudaima.label }}</label>
                    {{ obj.aj_jigoudaima }}
                    <span class="help-block">{{ obj.aj_jigoudaima.errors.0 }}</span>
                </div>
                <div class="form-group span4 {% if obj.aj_anyou.errors.0 %}has-error{% endif %}">
                    <label for="id_aj_anyou">{{ obj.aj_anyou.label }}</label>
                    {{ obj.aj_anyou }}
                    <span class="help-block">{{ obj.aj_anyou.errors.0 }}</span>
                </div>
            </div>
        </div>
        <div class="col-md-6 col-md-offset-3" style="text-align: center;margin-top: 20px">
            <input type="reset" value="重置" class="btn btn-info">
            <input type="submit" value="提交" class="btn btn-success">
        </div>
    </form>
{% endblock %}

{% block js %}
    <script>
        $('.form-group input,select').addClass('span4')
        $('.xzaj').addClass('active')
        $("#id_aj_time1").prop("type", "date")
        //消除错误提示
        $(":input").click(function () {
            $(this).next().text("");
            $(this).parents('div').removeClass("has-error")
        })
    </script>
{% endblock %}